from django.db import models
import django.utils.timezone as timezone

class a_rules(models.Model):
    id = models.BigAutoField(max_length=30, primary_key=True)
    rule_name = models.CharField(max_length=255)
    rule_level = models.IntegerField(null=True)
    class Meta:
        db_table = "a_rules"
        # abstract = True

class a_user_rule(models.Model):
    id = models.BigAutoField(max_length=30, primary_key=True)
    username = models.CharField(max_length=255)
    rule_id = models.IntegerField()
    is_delete = models.IntegerField(default=0)
    createDate = models.DateTimeField(default=timezone.now)
    class Meta:
        db_table = "a_user_rule"
        # abstract = True

class a_items(models.Model):
    id = models.BigAutoField(max_length=30, primary_key=True)
    item_name = models.CharField(max_length=255, null=True)
    item_jenkins = models.CharField(max_length=255, default="0")
    is_delete = models.IntegerField(default=0)
    createDate = models.DateTimeField(default=timezone.now)
    class Meta:
        db_table = "a_items"
        # abstract = True

class a_aduit_data(models.Model):
    id = models.BigAutoField(max_length=30, primary_key=True)
    originator = models.CharField(max_length=255)
    item_list = models.CharField(max_length=255)
    item_describe = models.TextField()
    describe = models.TextField()
    dismiss_role = models.IntegerField(default=0)
    dismiss_reason = models.TextField(null=True)
    product_des = models.TextField(null=True)
    process = models.IntegerField()
    status = models.IntegerField(default=0)
    is_delete = models.IntegerField(default=0)
    createDate = models.DateTimeField(default=timezone.now)
    completeDate = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = "a_aduit_data"
        # abstract = True